/**
 * Zhe Jiang HongCheng System Inc.
 * Copyright All Rights Reserved.
 */
package com.zjhcsoft.jbosscache.struts;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;

import java.util.Map;

/**
 * FileName : LoginInterceptor.java
 * CreateTime : 11-11-10 下午8:36
 * Description :  用户登录拦截器
 *
 * @author : liuys
 * @version : 1.0
 */
public class LoginInterceptor implements Interceptor {
    public void destroy() {
    }

    public void init() {
    }

    public String intercept(ActionInvocation actionInvocation) throws Exception {
        Map session = actionInvocation.getInvocationContext().getSession();
        if (session.get("sessionid") == null) {
            return "index.jsp";
        } else return actionInvocation.invoke();
    }
}
